package com.daxia.bumall.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.springframework.format.annotation.DateTimeFormat;

/**
 * Profit
 */
@Entity
@Table(name = "profit") 
public class Profit extends BaseModel {
	
	public Profit() {
	}
	
	public Profit(Long id) {
		this.id = id;
	}
	
	/**
	 * id
	 */
	@Id
	@GeneratedValue
	@Column(name = "id")
    private Long id;
	/**
	 * 受益人
	 */
	@ManyToOne
	@JoinColumn(name = "user_id")
    private User user;
	/**
	 * 收益类型
	 */
	@Column(name = "type")
    private Integer type;
	/**
	 * 收益金额
	 */
	@Column(name = "amount")
    private Double amount;
	/**
	 * 子帐号用户
	 */
	@ManyToOne
	@JoinColumn(name = "subAccountUserId")
    private User subAccountUserId;
	/**
	 * 子帐号开通者
	 */
	@ManyToOne
	@JoinColumn(name = "subAccountActivateUserId")
    private User subAccountActivateUserId;
	/**
	 * 备注
	 */
	@Column(name = "remark")
    private String remark;
	/**
	 * 时间
	 */
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")	
	@Column(name = "time")
    private Date time;
	
	public Long getId() {
    	return id;
    }
	
    public void setId(Long id) {
    	this.id = id;
    }
	
	public User getUser() {
    	return user;
    }
	
    public void setUser(User user) {
    	this.user = user;
    }
	
	public Integer getType() {
    	return type;
    }
	
    public void setType(Integer type) {
    	this.type = type;
    }
	
	public Double getAmount() {
    	return amount;
    }
	
    public void setAmount(Double amount) {
    	this.amount = amount;
    }
	
	public User getSubAccountUserId() {
    	return subAccountUserId;
    }
	
    public void setSubAccountUserId(User subAccountUserId) {
    	this.subAccountUserId = subAccountUserId;
    }
	
	public User getSubAccountActivateUserId() {
    	return subAccountActivateUserId;
    }
	
    public void setSubAccountActivateUserId(User subAccountActivateUserId) {
    	this.subAccountActivateUserId = subAccountActivateUserId;
    }
	
	public String getRemark() {
    	return remark;
    }
	
    public void setRemark(String remark) {
    	this.remark = remark;
    }
	
	public Date getTime() {
    	return time;
    }
	
    public void setTime(Date time) {
    	this.time = time;
    }
	
}
